@extends('admin.master')

@section('style')
   <link rel="stylesheet" href="{{ url('js/prettyphoto/css/prettyPhoto.css') }}">
@endsection

@section('top')
<div class="top-breadcrumb pull-left">{!! Breadcrumbs::render() !!}</div>
@endsection

@section('content')
	<div class="container-body">
	{!! Form::open(['route' => ['admin.contract.store'], 'class'=>'form-horizontal']) !!}
		@if ($customer)
			<input type="hidden" name="cid" value="{{ $customer->id }}">
			<div class="form-group">
				<label class="col-sm-4 control-label label-width">客户名称：</label>
				<div class="col-sm-6 row">
					<p class="form-control-static">{{ $customer->name }}</p>
				</div>
			</div>
		@endif
		<div class="form-group">
			<label class="col-sm-4 control-label label-width"><span class="text-danger">*</span> 合同号：</label>
			<div class="col-sm-8 row">
				{!! Form::text('contract_no', null, ['class'=>'form-control len contract-no', 'data-rule'=>'required']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">合同内容：</label>
			<div class="col-sm-8 row">
				<div id="fileupload" class="upload-sm">
					<a id="pickfile" data-type=1 data-name="contract[]" data-marks="contracts" class="btn btn-default btn-sm upload" href="javascript:;">
						上传合同
					</a>
				</div>
				<div class="attachments attachments-contract clearfix"></div>
				<div class="upload-message"></div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">发票回执：</label>
			<div class="col-sm-8 row">
				<div id="fileupload2" class="upload-sm">
					<a id="pickfile2" data-type=1 data-name="invoice_receipt[]" data-marks="receipts" class="btn btn-default btn-sm upload" href="javascript:;">上传发票回执</a>
				</div>
				<div class="attachments attachments-invoice-receipt clearfix"></div>
				<div class="upload-message"></div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">发票类型：</label>
			<div class="col-sm-8 row">
				<label class="radio-inline">
					{!! Form::radio('invoice_type', 1, true) !!} 普票
				</label>
				<label class="radio-inline">
					{!! Form::radio('invoice_type', 2) !!} 增票
				</label>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">发票状态：</label>
			<div class="col-sm-8 row">
				<label class="checkbox-inline">
				  <input type="checkbox" name="invoice_status" value="1"> 发票已开
				</label>
				<label class="checkbox-inline">
				  <input type="checkbox" name="invoice_receipt_status" value="1"> 发票回执已收
				</label>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width">备注：</label>
			<div class="col-sm-8 row">
				{!! Form::textarea('remark', null, ['class'=>'form-control len', 'rows'=>5]) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-4 control-label label-width"></label>
			<div class="col-sm-8 row">
				{!! Form::submit('提交', ['class'=>'btn btn-primary btn-submit']) !!}
			</div>
		</div>
	{!! Form::close() !!}
	</div>
@endsection

@section('foot')
<script src="{{ url('js/nice-validator/jquery.validator.js?local=zh-CN') }}"></script>
<script src="{{ url('js/upload/plupload.full.min.js') }}"></script>
<script src="{{ url('js/fileupload.js') }}"></script>
<script src="{{ url('js/prettyphoto/jquery.prettyPhoto.js') }}"></script>
<script type="text/javascript">

uploader({
	thumb: '80x80'
});
uploader({
	browse_button: 'pickfile2',
	thumb: '80x80',
	container: document.getElementById('fileupload2')
});  
</script>
@endsection